package jaxb.metagrammar;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;

import metagrammar.Operator;
import metagrammar.Operator.Instance;

@XmlAccessorType(XmlAccessType.FIELD)
public class AdaptedOperatorInstance {
    
    
    @XmlAttribute
    @XmlJavaTypeAdapter(OperatorToUUIDStringAdapter.class)
    private final Operator operator;
    private final metagrammar.Operator.Instance[] inputTuple;
    
    private AdaptedOperatorInstance()
    {
        operator = null;
        inputTuple = new metagrammar.Operator.Instance[] {};
    }
    
    public AdaptedOperatorInstance(Operator.Instance v)
    {
        operator = v.getOperator();
        inputTuple = v.getInputTuple().toArray(new Instance[] {});
    }
    
    public Operator getOperator()
    {
        return operator;
    }
    
    public metagrammar.Operator.Instance[] getInputTuple()
    {
        return inputTuple;
    }
    
}
